package com.example.chamberlainserver.mapper;

import com.example.chamberlainserver.Entry.AdjustmentLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 调整日志数据访问接口
 */
@Mapper
public interface AdjustmentLogMapper {
    /**
     * 根据ID查询调整日志
     */
    AdjustmentLog getAdjustmentLogById(@Param("id") String id);
    
    /**
     * 根据排班分配ID查询调整日志
     */
    List<AdjustmentLog> getAdjustmentLogsByAssignmentId(@Param("assignmentId") String assignmentId);
    
    /**
     * 根据调整类型查询调整日志
     */
    List<AdjustmentLog> getAdjustmentLogsByType(@Param("adjustmentType") String adjustmentType);
    
    /**
     * 根据调整人查询调整日志
     */
    List<AdjustmentLog> getAdjustmentLogsByAdjustedBy(@Param("adjustedBy") Integer adjustedBy);
    
    /**
     * 查询所有调整日志
     */
    List<AdjustmentLog> getAllAdjustmentLogs();
    
    /**
     * 新增调整日志
     */
    int insertAdjustmentLog(AdjustmentLog adjustmentLog);
    
    /**
     * 删除调整日志
     */
    int deleteAdjustmentLogById(@Param("id") String id);
    
    /**
     * 根据排班分配ID删除调整日志
     */
    int deleteAdjustmentLogsByAssignmentId(@Param("assignmentId") String assignmentId);
    
    /**
     * 分页查询调整日志列表
     */
    List<AdjustmentLog> getPagedAdjustmentLogList(Map<String, Object> params);
    
    /**
     * 获取分页查询的总记录数
     */
    Long getPagedAdjustmentLogCount(Map<String, Object> params);
}